<?php
// +----------------------------------------------------------------------
// | When work is a pleasure, life is a joy!
// +----------------------------------------------------------------------
// | User: ShouKun Liu  |  Email:24147287@qq.com  | Time:2016/12/11 15:26
// +----------------------------------------------------------------------
// | TITLE: 订单帮助函数
// +----------------------------------------------------------------------

if (!function_exists('os_to_str')) {

    /**
     * 订单转换函数
     * @param $status
     * @param string $keys
     * @return mixed
     */
    function os_to_str($status, $keys = '')
    {
        $statusList = \Common\Model\OrderModel::statusList();
        return (empty($keys)) ? $statusList[$status] : $statusList[$status][$keys];
    }

}

function sf_to_str($status, $keys = '')
{
    $statusList = \Common\Model\OrderModel::afterSaleList();
    return (empty($keys)) ? $statusList[$status] : $statusList[$status][$keys];

}

function time_to_date($time)
{
    if (empty($time)) return ;
  return  date('Y/m/d H:i:s', $time);
}


function o_p_s_to_str($status){
    $statusList = \Common\Model\OrderUpdateModel::$statusList;
    return $statusList[$status];
}